#include <stdio.h>
#include "lex.yy.h"


#ifndef SYMBOLS_TABLE_H
	#include "symbols_table.h"
#endif


#ifndef AST_H
	#include "ast.h"
#endif


AST_NODE *ast;


int main(int argc, char **argv)
{

  FILE *input;
  
  input = fopen(argv[1], "r");

  if(! input)
	printf("Erro na abertura do arquivo\n");
  else
  {	
  	initMe();
	
	yyin = input;


  	if(yyparse() == 1)
	{
		fclose(input);
		exit(3);
	}

  	printf("Tabela de Simbolos:\n");
  	print_table();
	
	printf("Arvore de Sintaxe Abstrata:\n");
	print_ast(ast);

	fclose(input);
	exit(0);
  
  }

}

